package cn.ekuma.data.ui.android;

import java.util.ArrayList;
import java.util.List;

import android.app.ProgressDialog;
import android.view.View;
import cn.ekuma.data.dao.I_DataLogic;
import cn.ekuma.data.dao.bean.I_Category;

import com.openbravo.data.basic.BasicException;

public abstract class AbstractTreeClassFinderActivate<T extends I_Category> extends AbstractTreeFinderActivate <T>{

	public AbstractTreeClassFinderActivate(I_DataLogic dataLogic) {
		super(dataLogic);
	}

	@Override
	protected void onResume() {
		super.onResume();
		loadDate();
	}
	
	protected void loadDate() {
		final ProgressDialog dialog = ProgressDialog.show(this, "", 
		        "查旬中，请稍等 …", true, true);
		new Thread(){
			@Override
			public void run(){
				try {
					List<T> lists=dataLogic.listWithClassName(getFindClass().getName());
					if(lists==null)
						lists=new ArrayList();
				    mHandler.obtainMessage(MSG_SUCCESS, lists).sendToTarget();			
				} catch (BasicException e) {
					mHandler.obtainMessage(MSG_FAILURE).sendToTarget();//获取图片失败   
				}
				dialog.dismiss(); 
			}
			}.start();		
	}

	public abstract Class getFindClass();

	@Override
	public void filterParaReset() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void initAdvSeachView() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean isQuickSeachAble() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onQuickSeach(String inputText) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public View createFilterPanel() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public View createAdvFilterPanel() {
		// TODO Auto-generated method stub
		return null;
	}
	
	
	
}
